#region Usings

using System.Runtime.Serialization;
using Newtonsoft.Json;

#endregion

namespace Karma.Framework.Core.Services.Invoker
{
    [JsonObject]
    [DataContract]
    public class ServiceResponse
    {
        public ServiceResponse(object result)
        {
            Success = true;
            ErrorCode = string.Empty;
            ErrorMessage = string.Empty;
            ErrorDetail = string.Empty;
            Result = result;
        }

        public ServiceResponse(string errCode, string errMsg, string det, bool report)
        {
            Success = false;
            ErrorCode = errCode;
            ErrorMessage = errMsg;
            ErrorDetail = det;
            Report = report;
        }

        [JsonProperty]
        [DataMember]
        public bool Success { get; set; }

        [JsonProperty]
        [DataMember]
        public bool Report { get; set; }

        [JsonProperty]
        [DataMember]
        public string ErrorCode { get; set; }

        [JsonProperty]
        [DataMember]
        public string ErrorMessage { get; set; }

        [JsonProperty]
        [DataMember]
        public string ErrorDetail { get; set; }

        [JsonProperty]
        [DataMember]
        public object Result { get; set; }
    }
}